package cn.hxzy.common;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;

@AllArgsConstructor
@NoArgsConstructor
@Getter
public enum AbnormalType {

    abnormalType_01(101,"道路拥堵"),
    abnormalType_02(102,"煤质异常"),
    abnormalType_03(103,"煤炭/站台排队车数过多"),
    abnormalType_04(104,"其他"),
    abnormalType_05(105,"货主异常");

    private Integer abnormalStatus;
    private String abnormalStatusName;

    public static String getAbnormalStatusValue(int index){
        for (AbnormalType value : AbnormalType.values()) {
            if (value.getAbnormalStatus() == index) {
                return value.getAbnormalStatusName();
            }
        }
        return null;
    }
}
